﻿using System;
using System.ComponentModel;
using System.Linq;
using ProjectEuler.Linq;

namespace ProjectEuler.Problems
{
    [EulerProblem(12, 76576500L)]
    [Description("What is the value of the first triangle number to have over five hundred divisors?")]
    internal sealed class Problem012 : EulerProblem
    {
        public override Object Solve()
        {
            return Integers.TriangleNumbers().SkipWhile(n => n.ProperDivisors().Count() < 500).First();
        }
    }
}
